import React, { Component } from 'react'
import { Carousel } from 'antd-mobile'
import { Link } from 'react-router-dom'

class Swiper extends Component {
  render() {
    return (
      <div>
        <Carousel
          autoplay={false}
          infinite
        >
          {this.props.data && this.props.data.map(val => (
            <Link
              key={val.id}
              to="/"
              style={{ display: 'inline-block', width: '100%', height: '176px' }}
            >
              <img
                src={val.img}
                alt=""
                style={{ width: '100%', verticalAlign: 'top' }} />
            </Link>
          ))}
        </Carousel>
      </div>
    );
  }
}

export default Swiper;
